package main

import (
	"fmt"
	"strings"
)

func main() {
	var str1 string
	fmt.Println("please input：")
	fmt.Scanf("%s", &str1)
	str1End := str1[2:]
	if IsDigit(str1) {
		fmt.Println("pass")
	} else if strings.HasPrefix(str1, "0x") || strings.HasPrefix(str1, "0o") ||
		strings.HasPrefix(str1, "0b") {
		if IsDigit(str1End) {
			fmt.Println("pass")
		} else {
			fmt.Println("no")
		}
	} else {
		println("no")
	}
}

// IsDigit /* 函数判断输入的字符串是否全为数字 */
func IsDigit(str string) bool {
	var numList = "0123456789"
	var flag = 0
	for i := 0; i < len(str); i++ {
		if !strings.Contains(numList, string(str[i])) {
		//如果不是数字，flag置为1，break
			flag = 1
			break
		}
		//如果全为数字，flag仍然置0
	}
	if flag == 0 {
		return true
	} else {
		return false
	}
}
